class Flower {
    int m_petal_count = 0;
    String m_string = "initial value";

    Flower(int petals) {
        m_petal_count = petals;
        System.out.println("Constructor w/ int arg only, petal_count=" + m_petal_count);
    }

    Flower(String ss) {
        System.out.println("Constructor w/ String arg only, s=" + ss);
        m_string = ss;
    }

    Flower(int petals, String s) {
        // System.out.println("int args & String");  // Call to 'this()' must be first statement in constructor body
        this(petals);
        // this(s);  // 不能同时调用两个构造函数
        this.m_string = s;
        System.out.println("int args & String");
    }

    Flower() {
        this(1, "default constructor (no args)");
        System.out.println("default constructor (no args)");
    }

    void printPetalCount() {
        // this() 不能在非构造函数中调用构造函数
        System.out.println("Petal count = " + m_petal_count + ", s = " + m_string);
    }
}

public class ThisConstructor {
    public static void main(String[] args) {
        Flower f = new Flower();
        f.printPetalCount();
    }
}

/*
构造器Flower(int petals, String s)表明，虽然可以使用this调用另一个构造器，但不能同时调用两个。
此外，构造器调用必须出现在方法的最开始部分，否则编译器会报错。
 */